home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 June / CHIP_CD_2004-06.iso / software / miranda_hit / files / mirinstsetup.exe / Miranda Installer 0.0.1.2 / MirandaInstaller.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-04-20  |  4.0 KB  |  124 lines

  1. /*
  2.     Miranda Installer - Installs nightlies and Miranda addons.
  3.     Copyright (C) 2002-2003 Goblineye Entertainment
  4.  
  5.     Authors: Saar (Tornado) and Kai (kai_b)
  6.  
  7.     This program is free software; you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation; either version 2 of the License, or
  10.     (at your option) any later version.
  11.  
  12.     This program is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.  
  17.     You should have received a copy of the GNU General Public License
  18.     along with this program; if not, write to the Free Software
  19.     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20. */
  21.  
  22. #pragma once
  23.  
  24. #define WIN32_LEAN_AND_MEAN
  25. #define SIDEBYSIDE_COMMONCONTROLS 1
  26.  
  27. #define _WIN32_WINNT 0x0400 // needed for WM_MOUSEWHEEL
  28.  
  29. #include <windows.h>
  30. #include <stdlib.h>
  31. #include <stdio.h>
  32. #include <shellapi.h>
  33. #include <commctrl.h>
  34. #include <commdlg.h>
  35. #include <objbase.h>
  36. #include <shellapi.h>
  37. #include <shlobj.h>
  38. #include <ddeml.h>
  39.  
  40. #include "Install.h"
  41. #include "PackageSelector.h"
  42. #include "Worker.h"
  43. #include "XMLParse.h"
  44. #include "zlib/unzip.h"
  45. //#include "langpack/langpack.h"
  46. #include "AggressiveOptimize.h"
  47. #include "Resource.h"
  48. /*
  49. #ifndef NDEBUG
  50. #include <crtdbg.h>
  51. #define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
  52. #endif*/
  53. #pragma hdrstop
  54.  
  55. typedef unsigned char byte;
  56.  
  57. #pragma comment(lib,"comctl32.lib")
  58. #pragma comment(lib,"comdlg32.lib")
  59.  
  60. // GetModuleFileNameEx()
  61. typedef DWORD WINAPI GMFileNameEx(HANDLE,HMODULE,LPTSTR,DWORD);
  62. typedef GMFileNameEx *pGMFileNameEx;
  63.  
  64.  
  65. typedef struct MAIN_OPTIONS_TYPE
  66. {
  67.     char szMirandaDirectory[MAX_PATH]; // Miranda's directory
  68.     
  69.     // more settings will follow here
  70.     DWORD dwFlags; // LSB means if to ask if to autorun every type of file
  71.                    // next 2 bits:   0 - always ask what packages to install
  72.                    //               1 - always install all
  73.                    //               2 - always install main
  74.                    // 8 - 1 - if the user doesn't want to get warnings about miranda is running and such
  75.     // profile
  76.     char szDefaultProfile[MAX_PATH];
  77.     // installation directories:
  78.     char szIconDirectory[MAX_PATH];
  79.     char szSoundDirectory[MAX_PATH];
  80.     char szLangDirectory[MAX_PATH];
  81.     char szToolDirectory[MAX_PATH];
  82.     char szSrcDirectory[MAX_PATH];
  83.     char szDocDirectory[MAX_PATH];
  84.     char szSkinDirectory[MAX_PATH];
  85. }    MAIN_OPTIONS;
  86.  
  87.  
  88. extern MAIN_OPTIONS g_WorkOptions;
  89. extern HINSTANCE g_hInstance;
  90. extern bool g_fStopThread;
  91.  
  92. // DDE #define's
  93. #define DDE_SERVICE "MirInst_MirandaInstallerDat"
  94. #define DDE_TOPIC "PassCmdLineArgs3"
  95. #define DDE_ITEM "CmdLine"
  96.  
  97. #define MI_CONTENT_TYPE "application/x-zip-mirandainstaller" // content type
  98. const WORD IndexToDirID[8] = { IDC_OPTSDLG_MIRANDADIR, IDC_OPTSDLG_ICONDIR, IDC_OPTSDLG_SOUNDDIR, IDC_OPTSDLG_LANGDIR, IDC_OPTSDLG_TOOLDIR, IDC_OPTSDLG_SRCDIR, IDC_OPTSDLG_DOCSDIR, IDC_OPTSDLG_SKINDIR };
  99.  
  100. // Misc.cpp
  101. HWND Is_App_Running(void);
  102. void Format_DisplaySize(char *lpoutText,DWORD dwSize);
  103. void Cleanup_FileList(GENERAL_FILELIST **ppFileList);
  104. void Switch_Slashes(char *lpText,bool fReverse);
  105. void Restart_Miranda(void);
  106. // type registration
  107. bool RegisterApplication(const char *szTypeName, const char *szDescription);
  108. bool RegisterExtension(const char *szExtension, const char *szTypeName);
  109.  
  110. // Procs.cpp
  111. INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
  112. INT_PTR CALLBACK LangPackDlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
  113. INT_PTR CALLBACK AboutDlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
  114.  
  115.  
  116. // Language support
  117. // The translation file is always langpack.txt and
  118. // resides in the same directory as MirInst.exe
  119. void LP_Init(void); // initialize
  120. void LP_UnInit(void); // die
  121.  
  122. // service types
  123. char *Translate(const char *lpString);
  124. void LP_TranslateDialog(HWND hwndDlg); // p.s. Also translates its menu